package vn.edu.thptduongbachmai.servers;

import com.vng.zing.jettyserver.WebServers;
import org.eclipse.jetty.servlet.ServletHandler;
import vn.edu.thptduongbachmai.handlers.HomeHandler;
import vn.edu.thptduongbachmai.handlers.ajax.AjaxSignInHandler;
import vn.edu.thptduongbachmai.handlers.ajax.AjaxSignUpHandler;

/**
 *
 * @author tiennv4
 */
public class HServers {

        public boolean setupAndStart() {
                WebServers servers = new WebServers("thptduongbachmai");
                ServletHandler handler = new ServletHandler();


                handler.addServletWithMapping(HomeHandler.class, "/home");
                handler.addServletWithMapping(AjaxSignInHandler.class, "/api/signin");
                handler.addServletWithMapping(AjaxSignUpHandler.class, "/api/signup");

                servers.setup(handler);
                return servers.start();
        }
}